﻿using System;
using System.Diagnostics;

namespace Red.Scripts.Project.Generator
{
    public static class Log
    {
        public static bool Silent { get; set; }

        public static void Write( string text )
        {
            if ( Silent )
                return;

            Console.Write( text );
            Debug.Print( text );
        }

        public static void WriteLine( string text )
        {
            if ( Silent )
                return;

            Console.WriteLine( text );
            Debug.Print( $"{text}\n" );
        }

        public static void WriteError( string text )
        {
            if ( Silent )
                return;

            Console.Error.Write( text );
            Debug.Print( text );
        }

        public static void WriteErrorLine( string text )
        {
            if ( Silent )
                return;

            Console.Error.WriteLine( text );
            Debug.Print( $"{text}\n" );
        }
    }
}
